package com.hbnu.serve;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class WordServe {
    public static void main(String[] args) {
        try (ServerSocket serverSocket = new ServerSocket(8080)) {
            System.out.println("背单词系统服务器启动，监听端口：" + 8080);

            while (true) {
                Socket clientSocket = serverSocket.accept();
                System.out.println("新客户端连接：" + clientSocket.getInetAddress());
                new ClientHandler(clientSocket).start();
            }
        } catch (IOException e) {
            System.err.println("服务器异常：" + e.getMessage());
        }
    }
}
